<?php

// Filename: /module/pam/config/module.config.php
return array(
    'controllers' => array(
        'invokables' => array(
            'pam\Controller\pam' => 'pam\Controller\PamController',
            'pam\Service\SocialPolicyServiceInterface' => 'pam\Service\SocialPolicyService',
            'pam\Service\AgeingPolicyServiceInterface' => 'pam\Service\AgeingPolicyService',
            'pam\Service\HealthPolicyServiceInterface' => 'pam\Service\HealthPolicyService',
            'pam\Service\IndicatorsServiceInterface' => 'pam\Service\IndicatorsService',
        ),
        'factories' => array(
            'pam\Controller\SocialPolicy' => 'pam\Factory\SocialPolicyControllerFactory',
            'pam\Controller\HealthPolicy' => 'pam\Factory\HealthPolicyControllerFactory',
            'pam\Controller\AgeingPolicy' => 'pam\Factory\AgeingPolicyControllerFactory',
            'pam\Controller\SocialIndicators' => 'pam\Factory\SocialIndicatorsControllerFactory',
            'pam\Controller\HealthIndicators' => 'pam\Factory\HealthIndicatorsControllerFactory',
            'pam\Controller\AgeingIndicators' => 'pam\Factory\AgeingIndicatorsControllerFactory',
            'pam\Controller\Research' => 'pam\Factory\ResearchControllerFactory',
        ),
    ),
    'view_manager' => array(
        'template_path_stack' => array(
            'pam' => __DIR__ . '/../view',
        ),
    ),
    'service_manager' => array(
        'factories' => array(
            'Zend\Db\Adapter\Adapter' => 'Zend\Db\Adapter\AdapterServiceFactory',
            'pam\Mapper\SocialPolicyDataAccess' => 'pam\Factory\SocialPolicyDataAccessFactory',
            'pam\Mapper\AgeingPolicyDataAccess' => 'pam\Factory\AgeingPolicyDataAccessFactory',
            'pam\Mapper\HealthPolicyDataAccess' => 'pam\Factory\HealthPolicyDataAccessFactory',
            'pam\Mapper\SocialPolicyIndicatorsDataAccess' => 'pam\Factory\SocialPolicyIndicatorsDataAccessFactory',
            'pam\Mapper\AgeingPolicyIndicatorsDataAccess' => 'pam\Factory\AgeingPolicyIndicatorsDataAccessFactory',
            'pam\Mapper\HealthPolicyIndicatorsDataAccess' => 'pam\Factory\HealthPolicyIndicatorsDataAccessFactory',
            'pam\Mapper\PolicyDataAccess' => 'pam\Factory\PolicyDataAccessFactory',
            'pam\Mapper\UserDataAccess' => 'pam\Factory\UserDataAccessFactory',
            'pam\Mapper\ResearchDataAccess' => 'pam\Factory\ResearchDataAccessFactory',
            'pam\Service\SocialPolicyService' => 'pam\Factory\SocialPolicyServiceFactory',
            'pam\Service\AgeingPolicyService' => 'pam\Factory\AgeingPolicyServiceFactory',
            'pam\Service\HealthPolicyService' => 'pam\Factory\HealthPolicyServiceFactory',
            'pam\Service\SocialIndicatorsService' => 'pam\Factory\SocialIndicatorsServiceFactory',
            'pam\Service\HealthIndicatorsService' => 'pam\Factory\HealthIndicatorsServiceFactory',
            'pam\Service\AgeingIndicatorsService' => 'pam\Factory\AgeingIndicatorsServiceFactory',
            'pam\Service\PolicyService' => 'pam\Factory\PolicyServiceFactory',
            'pam\Service\ResearchService' => 'pam\Factory\ResearchServiceFactory',
        )
    ),
    // This lines opens the configuration for the RouteManager
    'router' => array(
        // Open configuration for all possible routes
        'routes' => array(
            // Define a new route called "home"
            'home' => array(
                // Define the routes type to be "Zend\Mvc\Router\Http\Literal", which is basically just a string
                'type' => 'literal',
                // Configure the route itself
                'options' => array(
                    // Listen to "/pam" as uri
                    'route' => '/',
                    // Define default controller and action to be called when this route is matched
                    'defaults' => array(
                        'controller' => 'pam\Controller\pam',
                        'action' => 'index',
                    )
                ),
                'may_terminate' => true,
            ),
            'social' => array(
                'type' => 'segment',
                'options' => array(
                    'route' => '/social[/:action[/:id]]',
                    'constraints' => array(
                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
                        'id' => '[0-9]+',
                    ),
                    'defaults' => array(
                        'controller' => 'pam\Controller\SocialPolicy',
                        'action' => 'view',
                    )
                ),
                'may_terminate' => true,
            ),
            'social-indicators' => array(
                'type' => 'segment',
                'options' => array(
                    'route' => '/social-indicators[/:id][/:action[/:ind_id]]',
                    'defaults' => array(
                        'controller' => 'pam\Controller\SocialIndicators',
                        'action' => 'view',
                    ), 'constraints' => array(
                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
                        'ind_id' => '[0-9]+',
                        'id' => '[0-9]+',
                    ),
                ),
            ),
            'ageing' => array(
                'type' => 'segment',
                'options' => array(
                    'route' => '/ageing[/:action[/:id]]',
                    'constraints' => array(
                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
                        'id' => '[0-9]+',
                    ),
                    'defaults' => array(
                        'controller' => 'pam\Controller\AgeingPolicy',
                        'action' => 'view',
                    )
                ),
                'may_terminate' => true,
            ),
            'ageing-indicators' => array(
                'type' => 'segment',
                'options' => array(
                    'route' => '/ageing-indicators[/:id][/:action[/:ind_id]]',
                    'defaults' => array(
                        'controller' => 'pam\Controller\AgeingIndicators',
                        'action' => 'view',
                    ), 'constraints' => array(
                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
                        'ind_id' => '[0-9]+',
                        'id' => '[0-9]+',
                    ),
                ),
            ),
            'health' => array(
                'type' => 'segment',
                'options' => array(
                    'route' => '/health[/:action[/:id]]',
                    'constraints' => array(
                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
                        'id' => '[0-9]+',
                    ),
                    'defaults' => array(
                        'controller' => 'pam\Controller\HealthPolicy',
                        'action' => 'view',
                    )
                ),
                'may_terminate' => true,
            ),
            'health-indicators' => array(
                'type' => 'segment',
                'options' => array(
                    'route' => '/health-indicators[/:id][/:action[/:ind_id]]',
                    'defaults' => array(
                        'controller' => 'pam\Controller\HealthIndicators',
                        'action' => 'view',
                    ), 'constraints' => array(
                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
                        'ind_id' => '[0-9]+',
                        'id' => '[0-9]+',
                    ),
                ),
            ),
            'research' => array(
                'type' => 'segment',
                'options' => array(
                    'route' => '/research[/:action[/:id]]',
                    'constraints' => array(
                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
                        'id' => '[0-9]+',
                    ),
                    'defaults' => array(
                        'controller' => 'pam\Controller\Research',
                        'action' => 'view',
                    )
                ),
                'may_terminate' => true,
            ),
        )
    )
);
